package com.itheima.dianming.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R implements Serializable {
    public boolean flag;
    public Object data;
    public static R onflag(boolean flag,String msg){
        R r = new R();
        r.setFlag(flag);
        r.setData(msg);
        return r;
    }
    public static R onflag(boolean flag){
        R r = new R();
        r.setFlag(flag);
        return r;
    }
    public static R data(Object data){
        R r = new R();
        r.setData(data);
        r.setFlag(true);
        return r;
    }
    public static R all(boolean flag,Object data){
        return new R(flag,data);
    }

}
